<?php

namespace App\Http\Requests;


class SysConfigRequest extends BaseRequest
{
    public function rules()
    {
        return [
            'config_name' => 'required|between:1,100',
            'config_key' => 'required|between:1,100|unique:sys_config,config_key,'.$this->post('id'),
            'config_value' => 'required|between:1,500',
        ];
    }

    public function messages()
    {
        return [
            'config_name.required' => '参数名称必须填写',
            'config_name.between' => '参数名称1-100个字符之间',
            'config_key.required' => '参数键名必须填写',
            'config_key.between' => '参数键名1-100个字符之间',
            'config_key.unique' => '参数键名已存在',
            'config_value.required' => '参数键值必须填写',
            'config_value.between' => '参数键值1-100个字符之间',

        ];
    }
}
